package io.zhengsh.vvip.jvm.oom;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

/**
 * VM Args：-XX:MetaspaceSize=2m -XX:MaxMetaspaceSize=2m
 *
 * @author zhengsh
 * @date 2021-08-13
 */
public class RuntimeConstantPoolOOM {

    public static void main(String[] args) {
        Set<String> set = new HashSet<String>();
        while (true) {
            String uuid = UUID.randomUUID().toString();
            set.add(uuid.intern());
        }
    }
}
